home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8386 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: gettimeofday() makes me mad !
  5. Date: 1 Mar 96 11:47:09 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.825680829@rscernix>
  8. References: <208_9602292012@dudd.uniserve.com>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <208_9602292012@dudd.uniserve.com> Carl@dudd.uniserve.com (Carl) writes:
  13.  
  14. >What about if you use a function similar to the Borland  clock_t() which
  15. >returns the amount of clock ticks since program start.
  16.  
  17. The name is clock() and the function is _useless_ to keep track of real
  18. time in a multitasking environment.  BTW, clock() is a standard C function,
  19. it has nothing to do with Borland.
  20.  
  21. >Don't clock ticks
  22. >happen like 18 times per second on most systems?
  23.  
  24. It depends on your definition of "most".  If you count all the MSDOS and
  25. Windows boxes, they do represent most of the computers in current use.
  26. If you count operating systems, which is a more reasonable thing, 
  27. most of them don't use a 55 ms real time clock.  Even when running on
  28. PC hardware (on my Linux box, clock ticks happen 100 times per second).
  29.  
  30. Anyway, the question is moot, because you have to use the CLOCKS_PER_SEC
  31. macro to convert the value returned by clock() into seconds.
  32.  
  33. Dan
  34. --
  35. Dan Pop
  36. CERN, CN Division
  37. Email: danpop@mail.cern.ch 
  38. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  39.